{extend name="public/base"/}
{block name="style"}
  <style type="text/css">
    .webmanage-item{margin: 15px 10px;text-align: center;color: #666;font-size: 16px;border-right: 1px solid #ddd;}
    .webmanage-item a{color: #666;}
  </style>
{/block}

{block name="main"}
  <!--此页面主体内容-->
  <div class="dashboard-container">
  {php}
    if(check_install_module('cms')){ 
  {/php}
    {:widget('cms/Dashboard/tool')}
  {php}}{/php}
  <div class="row">

      <div class="col-md-6">
          <div class="box box-danger">
                <div class="box-header with-border">
                  <h3 class="box-title">最新注册用户</h3>

                  <div class="box-tools pull-right">
                    <span class="label label-danger hide">326732个新用户</span>
                    <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
                    </button>
                    <button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i>
                    </button>
                  </div>
                </div>
                <!-- /.box-header -->
                <div class="box-body no-padding">
                  <ul class="users-list clearfix">
                    <li>
                        <img src="http://wx.qlogo.cn/mmopen/ajNVdqHZLLBUbyX40qPgDyU57GDQ4xxxIVibSywVXl0pDdJpqrQDp5Yp1iaPlkU3QhZ2r3h1etngXv8hL6BMKOUg/0" width="45" height="45">
                        <a class="users-list-name" href="/admin.php?s=/Admin/User/edit/uid/326795.html">新宇若水</a>
                        <span class="users-list-date">32分钟前</span>
                      </li><li>
                        <img src="http://wx.qlogo.cn/mmopen/9UjCmequjUib5ywquUZY1ibbK663y8qiaGXlcxQ4Hgjem9Hp2tVsnMbwErjuMuerBQMnrrK8NlmmeiaHT58ic9rG4SXI0l05IYQq1/0" width="45" height="45">
                        <a class="users-list-name" href="/admin.php?s=/Admin/User/edit/uid/326794.html">可爱</a>
                        <span class="users-list-date">38分钟前</span>
                      </li><li>
                        <img src="http://wx.qlogo.cn/mmopen/eCXtiatJG2qA7d9wjNKktQUMjaiajx4SCoL5Phc5NqRKg4bltVHI94hpZl7x1R2E14Xbb5x7wDJkiaMrYgJx0Nb8nGuvicWcEymc/0" width="45" height="45">
                        <a class="users-list-name" href="/admin.php?s=/Admin/User/edit/uid/326793.html">王晓雪</a>
                        <span class="users-list-date">57分钟前</span>
                      </li><li>
                        <img src="http://wx.qlogo.cn/mmopen/RlLibmYfibwCs6EPOR9ZRxyckic1kLZMqAibdQgC5RXIuaoIAQAYL1IWfxcuzBfqwuicxr246CszaXmmZViaDprDibR4mlMBib6lz30j/0" width="45" height="45">
                        <a class="users-list-name" href="/admin.php?s=/Admin/User/edit/uid/326792.html">陈学映</a>
                        <span class="users-list-date">1小时前</span>
                      </li><li>
                        <img src="http://wx.qlogo.cn/mmopen/LIQXXYlOuN2jy45Uy8FrA1XpHMaUGvtGYrC9XIcgI2MKvzlPsb4uISBUpLxOXZ6nlqXpCvMoEicDM4HSltm9O4nGyvU11Lzib1/0" width="45" height="45">
                        <a class="users-list-name" href="/admin.php?s=/Admin/User/edit/uid/326787.html">安妮</a>
                        <span class="users-list-date">2小时前</span>
                      </li><li>
                        <img src="http://wx.qlogo.cn/mmopen/PiajxSqBRaELGyaDWOrqGfF7JibvU3hbuA7yYHJne8fw68wFQHjZTibcMxoR4keH7DSia4QuREIskmpe3mdxiaGwfJw/0" width="45" height="45">
                        <a class="users-list-name" href="/admin.php?s=/Admin/User/edit/uid/326782.html">蒂默波尔</a>
                        <span class="users-list-date">2小时前</span>
                      </li><li>
                        <img src="http://wx.qlogo.cn/mmopen/ajNVdqHZLLA7FINjLK0kxvyX9BhicrMF31ldiaiagMZhv8crokiavvNuLC1od9K8lGluATGZhFdA1eCeIllqXGO1Sw/0" width="45" height="45">
                        <a class="users-list-name" href="/admin.php?s=/Admin/User/edit/uid/326781.html">老孟ღ</a>
                        <span class="users-list-date">2小时前</span>
                      </li><li>
                        <img src="http://wx.qlogo.cn/mmopen/RLZcTUr4lyhBYRz8vKMAVicmHdShyTG9DA1jEg9PMkBKy8M2KwAX9mOHD3TudcoL8Ph8gXwSlaBRW6MpsqKibd8Y8oXETIsUsic/0" width="45" height="45">
                        <a class="users-list-name" href="/admin.php?s=/Admin/User/edit/uid/326780.html">若相惜♀不弃</a>
                        <span class="users-list-date">2小时前</span>
                      </li><li>
                        <img src="http://wx.qlogo.cn/mmopen/l4fl4iboCt9RZUw8sVElUyz3dQchzKcpiaTZicLIH2YhkA3Qypvhc2ZyjLzxzUIYsf9NtFpicibeJfGF8AQZSiaBq8zju3Mias6YZsC/0" width="45" height="45">
                        <a class="users-list-name" href="/admin.php?s=/Admin/User/edit/uid/326779.html"> 靖子玉，</a>
                        <span class="users-list-date">3小时前</span>
                      </li><li>
                        <img src="http://wx.qlogo.cn/mmopen/RLZcTUr4lygZUPVuuJaW7VAZnjrKjZwuGgLopnfaKLSGmecg1U7IItQdvvynWicZxNKGUiaySp1b79NDsx0hgmfzd0Uic8LmnhI/0" width="45" height="45">
                        <a class="users-list-name" href="/admin.php?s=/Admin/User/edit/uid/326778.html">倪远</a>
                        <span class="users-list-date">3小时前</span>
                      </li><li>
                        <img src="http://wx.qlogo.cn/mmopen/Q3auHgzwzM6hlc1tcs5ya8Qdgeph73AW9Bl4tGbmg1yGtyaDJjgKuqSe4PialEfsdH3icVG3ILSZISDicT5HiaU9lqRiaibMLWd2rZnxYAP8HClE4/0" width="45" height="45">
                        <a class="users-list-name" href="/admin.php?s=/Admin/User/edit/uid/326777.html">子森</a>
                        <span class="users-list-date">3小时前</span>
                      </li><li>
                        <img src="http://wx.qlogo.cn/mmopen/9UjCmequjUib5ywquUZY1ibYhLogodtGeVc7E7jTG9XyrLn4BwPB7MicQ58KIOkJrxbTqk5snhXOlTYoglSm1HIXcGzAAo251so/0" width="45" height="45">
                        <a class="users-list-name" href="/admin.php?s=/Admin/User/edit/uid/326776.html">紳士自己</a>
                        <span class="users-list-date">3小时前</span>
                      </li>                  
                  </ul>
                  <!-- /.users-list -->
                </div>
                <!-- /.box-body -->
                <div class="box-footer text-center">
                  <a href="{:url('admin/User/index')}" class="uppercase">查看所有用户</a>
                </div>
                <!-- /.box-footer -->
              </div>
        </div> 

      <div class="col-md-6">
          <div class="box box-default">
            <div class="box-header with-border">
              <h3 class="box-title">用户增长分析</h3>

              <div class="box-tools pull-right">
                <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
                </button>
              </div>
              <!-- /.box-tools -->
            </div>
             <div class="box-body">
                <div class="users-chart mt-10">
                    <div id="user_statistics" style="height: 230px;"></div>
                </div>
             </div>
                   
          </div>
        </div> 
    <!--     <div class="col-md-12">
          <div class="box box-solid">
            <div class="box-header with-border">
              <h3 class="box-title">网站管理</h3>
            </div>
            <div class="box-body">
              <div class="col-md-2 webmanage-item">
              <a href="#">
                <div><i class="fa fa-file-text-o"></i> 文章</div>
                <h4>10</h4>
                </a>
              </div>
              <div class="col-md-2 webmanage-item">
                <a href="#">
                  <div><i class="fa fa-map-o text-green"></i> 产品</div>
                  <h4>98</h4>
                </a>
              </div>
              <div class="col-md-2 webmanage-item">
                <a href="#">
                  <div><i class="fa fa-photo text-aqua"></i> 图片</div>
                  <h4>76</h4>
                </a>
              </div>
              <div class="col-md-2 webmanage-item">
                <a href="#">
                  <div><i class="fa fa-users text-red"></i> 用户</div>
                  <h4>129</h4>
                </a>
              </div>
              <div class="col-md-2 webmanage-item">
                <a href="#">
                <div><i class="fa fa-comment text-yellow"></i> 留言</div>
                <h4>3261</h4>
                </a>
              </div>

            </div>
          </div>
        </div>-->
          <div class="col-md-7">
            <div class="box box-default">
              <div class="box-header with-border">
                <h3 class="box-title">系统信息</h3>

                <div class="box-tools pull-right">
                  <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
                  </button>
                </div>
                <!-- /.box-tools -->
              </div>
               <div class="box-body">
                  <table class="table table-bordered">
                    <tbody>
                      {volist name="server_info" id="info" key="i" mod="2"}
                          {eq name="mod" value="0"}<tr>{/eq}
                          <td>{$key}：<span style="font-weight:normal!important;">{$info}</span></td>
                            {if condition="$i eq count($server_info)"}</tr>
                          {else/}
                            {eq name="mod" value="1"}</tr>{/eq}
                          {/if}
                      {/volist}
                    </tbody>
                  </table>
               </div>
                     
            </div>
          </div>  

          <div class="col-md-5">
            <div class="box">
              <div class="box-header">
                <h3 class="box-title">官方动态</h3>
              </div>
              <!-- /.box-header -->
              <div class="box-body pt-0" id="eacoo_news">
               
              </div>
              <!-- /.box-body -->
            </div>
          </div>
    </div> 

  </div>
{/block}
{block name="script"}
<script src="__STATIC__/libs/echarts/echarts.common.min.js" type="text/javascript"></script>
<script type="text/javascript">
  var myChart = echarts.init(document.getElementById('user_statistics'),'macarons');
  var res = {$user_result};
  option = {
        title : {
            text: '七日增长',
            textStyle:{color:'#666',fontSize:12},
        },
        tooltip : {
            trigger: 'axis'
        },
        legend: {
            data:['用户增长','七日待返积金']
        },
        toolbox: {
            show : true,
            feature : {
                mark : {show: true},
                dataView : {show: true, readOnly: false},
                magicType : {show: true, type: ['line', 'bar']},
                restore : {show: true},
            }
        },
        calculable : true,
        xAxis : [
            {
              name:'日期',
              type : 'category',
              boundaryGap : false,
              data : res.time,
              axisLabel : {
                  //formatter: '{value}',
                  interval:0,
                  textStyle:{fontSize:8}
              }
            }
        ],
        yAxis : [
            {
                name:'数量（人）',
                type : 'value',
                axisLabel : {
                    //formatter: '{value}',
                    textStyle:{fontSize:8}
                }
            }
        ],
        series : [
            {
                name:'增长用户',
                type:'line',
                data:res.data
            }
        ]
    };
    myChart.setOption(option);

  </script>
<script type="text/javascript" src="__STATIC__/libs/artTemplate/template.js"></script>
<script id="eacoo_news_list" type="text/html">
  <table class="table table-condensed f14">
    <tbody>
    <% for (var i = 0; i < data.length; i ++) { %>
    <% var row = data[i]; %>
        <tr>
          <td><a href="<%= row.href %>"><%= row.title %></a></td>
        </tr>
    <% } %>
    </tbody>
  </table>
</script>

<script type="text/javascript">
  $(function(){ 
    $.ajax({  
        type : "get",  
        url : "__ROOT__{:url('admin/dashboard/getEacooNews')}",  
        data:{access_token:'dc364ec66f5d7c4d0a1948eecf35db73'},
        dataType : "json",
        success : function(result){
            //更新官方动态
          if (result.code==1) {
              var html = template('eacoo_news_list', result);
              $('#eacoo_news').html(html);
          } else{
              $('#eacoo_news').html('暂无内容');
          }
        },  
        error:function(){  
            console.debug('eacoo_news fail！');
        }  
    });   

    //阿里云提示
    {php}if(config('aliyun_oss.enable')!=1){{/php}
      layer.alert('欢迎使用小京东+商城系统，请优先配置/开启 阿里OSS对象存储服务 ，让您的数据更安全可靠，数据掌握在自己手中。<br/>如因未配置/开启<a href="https://www.aliyun.com/product/oss">阿里云OSS</a>，造成的数据丢失，由您自行负责！！快去配置吧~<br/>如何申请以及配置阿里OSS，请参考 阿里OSS配置教程 。', {icon: 6}); 
    {php}}{/php}
  })
</script>
{/block}